package com.leunpha.mini.net.factory;

import com.leunpha.mini.net.RequestType;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpRequestBase;

/**
 * User: zhoujingjie
 * Date: 14-5-13
 * Time: 下午1:34
 */
public class RequestFactory {

    public static HttpRequestBase getMethod(RequestType type,String uri){
        switch (type){
            case GET:
                return new HttpGet(uri);
            case POST:
                return new HttpPost(uri);
            default:
                return new HttpGet(uri);
        }
    }
}
